<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" isELIgnored="false" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <style type="text/css">
        .l{

            align-content: center;
            width: 500px;
            height: 400px;
            margin-top: 250px;
            margin-left: 600px;
            margin-right: 500px;
        }
    </style>
</head>
<body style="background: url(/images/1.jpg)">

<div class="l">
<form action="find">
    <input type="text" name="name" placeholder="账号" class="form-control">
    <button class="btn btn-primary">搜索</button>
    <a href="/user/addUser.jsp">增加用户</a>
    <a href="logon">注销</a>

    <table border="1" cellpadding="1" cellspacing="0" width="310">
        <tr>
            <th>账号</th>
            <%--<th>密码</th>--%>
            <th>姓名</th>
            <th>邮箱</th>
            <th>信息</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${list}" var="users">
            <tr>
                <td>${users.name}</td>
                <%--<td>${users.password}</td>--%>
                <td>${users.orders}</td>
                <td>${users.email}</td>
                <td>${users.message}</td>
                <td><a href="/user/deleteUser?id=${users.id}">删除</a>&nbsp;&nbsp;
                    <a href="/user/editUserId?id=${users.id}">修改</a></td>
            </tr>
        </c:forEach>
    </table>

<a href="javascript:history.back(-1)">返回上一页</a>
</form>
        <font size="2">共 ${page.totalPageCount} 页</font> <font size="2">第
        ${page.pageNow} 页</font> <a href="/user/showNewInfo?pageNow=1">首页</a>
        <c:choose>
            <c:when test="${page.pageNow - 1 > 0}">
                <a href="${pageContext.request.contextPath}/user/showNewInfo?pageNow=${page.pageNow - 1}">上一页</a>
            </c:when>
            <c:when test="${page.pageNow - 1 <= 0}">
                <a href="/user/showNewInfo?pageNow=1">上一页</a>
            </c:when>
        </c:choose>
        <c:choose>
            <c:when test="${page.totalPageCount==0}">
                <a href="/user/showNewInfo?pageNow=${page.pageNow}">下一页</a>
            </c:when>
            <c:when test="${page.pageNow + 1 < page.totalPageCount}">
                <a href="/user/showNewInfo?pageNow=${page.pageNow + 1}">下一页</a>
            </c:when>
            <c:when test="${page.pageNow + 1 >= page.totalPageCount}">
                <a href="/user/showNewInfo?pageNow=${page.totalPageCount}">下一页</a>
            </c:when>
        </c:choose>
        <c:choose>
            <c:when test="${page.totalPageCount==0}">
                <a href="/user/showNewInfo?pageNow=${page.pageNow}">尾页</a>
            </c:when>
            <c:otherwise>
                <a href="/user/showNewInfo?pageNow=${page.totalPageCount}">尾页</a>
            </c:otherwise>
        </c:choose>

</div>
</body>

</html>